package ch.zbw.pra.sysventory.ui.gui.utilities;

import javax.swing.JComponent;
import javax.swing.text.JTextComponent;

import ch.zbw.pra.sysventory.ui.gui.utilities.DefaultFonts.FontType;

public class TextLayout {

	// set the fontsize for components they arent textcomponents
	public static void addStyleToComponent(final JComponent component, FontType fontType) {
		if (component != null) {
			component.setFont(new DefaultFonts().getFont(fontType));
		}
	}

	// set the fontsize for textcomponents with option editable true or false
	public static void addStyleToTextComponentAndNotEditable(final JTextComponent textComponent, FontType fontType, final boolean editable) {
		if (textComponent != null) {
			TextLayout.addStyleToComponent(textComponent, fontType);
			textComponent.setEditable(editable);
		}
	}
}